﻿using System;
using System.ComponentModel;
using System.Windows.Input;
using LINQPad.Extensibility.DataContext;
using LINQPad.OpenAccess.Settings;
using LINQPad.OpenAccess.UI.Infrastructure;
using Telerik.OpenAccess.Metadata;

namespace LINQPad.OpenAccess.UI.ViewModel
{
    /// <summary>
    /// ConnectionSettings - ViewModel
    /// </summary>
    public interface IConnectionSettingsViewModel : IPersistableSettingsViewModel<DriverSettings>, IActiveAware, INotifyPropertyChanged, IDataErrorInfo
    {
        #region - Functions

        /// <summary>
        /// Determines whether the specified provider is supported.
        /// </summary>
        /// <param name="providerName">Name of the provider.</param>
        /// <returns>
        ///   <c>true</c> if the specified provider is supported; otherwise, <c>false</c>.
        /// </returns>
        bool IsProviderSupported( string providerName );
        /// <summary>
        /// Refreshes this instance.
        /// </summary>
        void Refresh( );

        #endregion

        #region - Commands

        /// <summary>
        /// Gets the refresh command.
        /// </summary>
        /// <value>
        /// The refresh command.
        /// </value>
        ICommand RefreshCommand { get; }
        /// <summary>
        /// Gets the test connection command.
        /// </summary>
        /// <value>
        /// The test connection command.
        /// </value>
        ICommand TestConnectionCommand { get; }

        #endregion

        #region - Properties

        /// <summary>
        /// Gets or sets the host.
        /// </summary>
        /// <value>
        /// The host.
        /// </value>
        ConnectionSettingsHostViewModel Host { get; set; }
        /// <summary>
        /// Gets the description.
        /// </summary>
        /// <value>
        /// The description.
        /// </value>
        string Description { get; }
        /// <summary>
        /// Gets the name.
        /// </summary>
        /// <value>
        /// The name.
        /// </value>
        string Name { get; }
        /// <summary>
        /// Gets the owner.
        /// </summary>
        /// <value>
        /// The owner.
        /// </value>
        DriverSettingsViewModel Owner { get; }
        /// <summary>
        /// Gets the name of the provider.
        /// </summary>
        /// <value>
        /// The name of the provider.
        /// </value>
        string ProviderName { get; set; }

        #endregion
    }
}
